



def getterminal_node_id(terminal_nodes_name,namelist):
    terminal_nodes = []
    for i in terminal_nodes_name:
        a = [j for j, x in enumerate(namelist) if x in i]
        terminal_nodes+=a

    return  terminal_nodes